package com.foreknow.elmboot.service.impl;
import com.foreknow.elmboot.mapper.UserMapper;
import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public User getUserByIdByPass(String userId, String password) {
        User objects = null;

        try {
            objects=userMapper.getUserByIdByPass(userId,password);
            return objects;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return objects;
    }

    @Override
    public int saveUser(User user) {
        int objects = 0;

        try {
            objects=userMapper.saveUser(user);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return objects;
    }
}
